package com.example.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author 王鹤蒲
 * @since 2024-01-21
 */
@Data
@Accessors(chain = true)
@TableName("sys_department")
@ApiModel(value = "Department对象", description = "")
public class Department implements Serializable {

    private static final long serialVersionUID = 1L;

      @ApiModelProperty("科室ID")
      @TableId(value = "id", type = IdType.AUTO)
      private Integer id;

      @ApiModelProperty("科室名称")
      private String name;

      @ApiModelProperty("科室描述")
      private String description;

      @ApiModelProperty("科室主管")
      private String leader;

      @ApiModelProperty("联系方式")
      private String phone;

      @ApiModelProperty("邮箱地址")
      private String email;

      @ApiModelProperty("科室位置")
      private String address;

      @ApiModelProperty("一类科室ID")
      private Integer parentId;

      @ApiModelProperty("排序")
      private Integer sortNum;

      @ApiModelProperty("状态（1：可用，0：不可用）")
      private String status;

      @ApiModelProperty("删除标志（1：已删除，0：未删除）")
      private String delFlag;

      @ApiModelProperty("创建者")
      private String createBy;

      @ApiModelProperty("创建时间")
      @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
      @JsonSerialize(using = LocalDateTimeSerializer.class)
      @JsonDeserialize(using = LocalDateTimeDeserializer.class)
      private LocalDateTime createTime;

      @ApiModelProperty("更新者")
      private String updateBy;

      @ApiModelProperty("更新时间")
      @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
      @JsonSerialize(using = LocalDateTimeSerializer.class)
      @JsonDeserialize(using = LocalDateTimeDeserializer.class)
      private LocalDateTime updateTime;

      @ApiModelProperty("备注")
      private String remark;

      @TableField(exist=false)
      private List<Department> secondClassDepartmentList;

      @TableField(exist=false)
      private List<Doctor> doctorList;


}
